﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class bb_按车辆查询 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void BindData()    //绑定数据源
    {
        users tmp = new users();
        gvInsert.DataSource = tmp.GetALLUsers2().Tables[0].DefaultView;
        gvInsert.DataBind();
    }
    protected void gvInsert_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        gvInsert.PageIndex = e.NewPageIndex;
        BindData();//重新绑定数据

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string id = txtID.Text.Trim();
        users us = new users();
        us.id = id;
        //gvInsert.DataSource = us.select1(us);
        //gvInsert.DataBind();
        int result = us.isExist2(us);
        if (result > 0)
        {
            Session["id"] = id;
            gvInsert.DataSource = us.select2(us);
            gvInsert.DataBind();
            //Response.Redirect("~/bb/主界面.aspx");
        }
        else
        {
            Response.Write("<script >alert(\"查询的内容不存在！请重新输入！\")</script>");
        }

    }
   
}